package com.example.juc.until;

import java.util.function.Consumer;
import java.util.function.Function;
import java.util.function.Predicate;
import java.util.function.Supplier;

public class FuncationAndInterfs {
    static Integer num =1;
    public static void main(String[] args) {
        //将传入的值输出
        Function function = i -> i;
        System.out.println(function.apply(1));
        //判定型接口 给一个参数判断是否为空
        Predicate<String> predicate =((String i) ->{return i.isEmpty();});

        //生产(供给)型接口
        Supplier<Integer> supplier = () ->{
            return num+1;
        };

        //消费型接口
        Consumer<Integer> consumer =(num) ->{
            System.out.println(supplier.get());
        };
        consumer.accept(num);
    }
}
